from core.support import set_cutscene
from core.item import Item
from core.action import Action

class Binoculars(Item):
    def __init__(self):
        Item.__init__(self, "Binoculars")    # do basic initialization for every item

        
        # build list of actions
        self.add_action(Use)

    
    def get_description(self):
        return "Binoculars"

# define actions for this item

class Use(Action):
    def __init__(self):
        Action.__init__(self, "Use")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Binoculars: view far into the distance"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "post"
    
    # only works in basement. add cutscene
    def do_action(self,game,room,request):
        if room.get_id() == 'river4':
            if room.village_undiscovered:
                set_cutscene("You notice what looks to be an indigenous village")
                room.village_undiscovered = False
            else:
                set_cutscene("You have confirmed that the village is in fact real, and that you are not going insane.")
        else:
            set_cutscene("You look far into the distance and notice that things are only going to get worse.")

